package com.cn.stepLock.event;

import com.cn.stepLock.listener.BaseListener;

import java.util.ArrayList;
import java.util.EventListener;
import java.util.EventObject;
import java.util.List;

/**
 * @author Aaron
 * @desc
 * @createTime 2022-02-24 6:17
 * @since
 */
public class BaseEvent extends EventObject {

    List<BaseListener> eventListenerList;

    /**
     * Constructs a prototypical Event.
     *
     * @param source The object on which the Event initially occurred.
     * @throws IllegalArgumentException if source is null.
     */
    public BaseEvent(Object source) {
        super(source);
        this.eventListenerList = new ArrayList<>();
    }

    void addListener(BaseListener eventListener){
        eventListenerList.add(eventListener);
    }

    public List<BaseListener> getEventListenerList() {
        return eventListenerList;
    }
}
